package cc.beup.common.response;

import cc.beup.common.constant.PlatformResponseCodeEnum;
import cc.beup.common.exception.PlatFormBizException;
import lombok.Data;

/**
 * @Author: Byron Bai
 * @Date: 2021/4/18 20:04
 * @Description:
 */
@Data
public class PlatFormResponse<T> {

    private String code;
    private String msg;
    private T data;

    public PlatFormResponse(String code, String msg, T data) {
        super();
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public PlatFormResponse(T data) {
        super();
        this.code = PlatformResponseCodeEnum.EXECUTE_SUCCESS.getCode();
        this.msg = PlatformResponseCodeEnum.EXECUTE_SUCCESS.getMsg();
        this.data = data;
    }

    public PlatFormResponse(PlatFormBizException platFormException, T data) {
        super();
        this.code = platFormException.getCode();
        this.msg = platFormException.getMsg();
        this.data = data;
    }


    public PlatFormResponse() {
    }
}
